﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ElingOA6_Admin_DSJCJ.BLL
{
    /// <summary>
    /// 网盘
    /// </summary>
    public partial class FTP_New
    {
        private readonly ElingOA6_Admin_DSJCJ.DAL.FTP_New dal = new ElingOA6_Admin_DSJCJ.DAL.FTP_New();
        public FTP_New()
        { }
        #region  BasicMethod
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(decimal FParentID, string FLogID, string FEntityNo, decimal FID)
        {
            return dal.Exists(FParentID, FLogID, FEntityNo, FID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public decimal Add(ElingOA6_Admin_DSJCJ.Model.FTP_New model)
        {
            return dal.Add(model);
        }
        public DataTable GetVModelList(string strwhere)
        {
            return dal.GetVModelList(strwhere);
        }
         public DataTable GetAllFileCteByDirOrFileFid(string strWhere)
        {
            return dal.GetAllFileCteByDirOrFileFid(strWhere);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ElingOA6_Admin_DSJCJ.Model.FTP_New model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(decimal FID)
        {

            return dal.Delete(FID);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(decimal FParentID, string FLogID, string FEntityNo, decimal FID)
        {

            return dal.Delete(FParentID, FLogID, FEntityNo, FID);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string FIDlist)
        {
            return dal.DeleteList(FIDlist);
        }





        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }



        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            return dal.GetRecordCount(strWhere);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  已经使用的
        /// <summary>
        /// 获得数据列表
        /// <creator>sunlj</creator>
        /// <date>2014-09-22</date>
        /// </summary>
        public List<ElingOA6_Admin_DSJCJ.Model.FTP_New> GetListByEntityNo(string FEntityNo)
        {
            DataSet ds = dal.GetListByEntityNo(FEntityNo);
            return DataTableToList(ds.Tables[0]);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ElingOA6_Admin_DSJCJ.Model.FTP_New> DataTableToList(DataTable dt)
        {
            List<ElingOA6_Admin_DSJCJ.Model.FTP_New> modelList = new List<ElingOA6_Admin_DSJCJ.Model.FTP_New>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                ElingOA6_Admin_DSJCJ.Model.FTP_New model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

        public int GetChildCount(decimal id, string entityNo)
        {
            return dal.GetChildCount(id, entityNo);
        }

        /// <summary>
        /// 得到一个对象实体
        /// <creator>sunlj</creator>
        /// <date>2014-09-22</date>
        /// </summary>
        public ElingOA6_Admin_DSJCJ.Model.FTP_New GetModel(decimal FID)
        {

            return dal.GetModel(FID);
        }

        /// <summary>
        /// 增加目录
        /// <creator>sunlj</creator>
        /// <date>2014-09-22</date>
        /// </summary>
        /// <param name="FTP_NewModel"></param>
        /// <returns></returns>
        public decimal AddFTP_New(Model.FTP_New FTP_NewModel)
        {
            return dal.AddFTP_New(FTP_NewModel);
        }

        /// <summary>
        /// 修改目录
        /// <creator>sunlj</creator>
        /// <date>2014-09-22</date>
        /// </summary>
        /// <param name="FTP_NewModel"></param>
        /// <returns></returns>
        public void UpdateFTP_New(Model.FTP_New FTP_NewModel)
        {
            dal.UpdateFTP_New(FTP_NewModel);
        }

        /// <summary>
        /// 删除目录
        /// <creator>sunlj</creator>
        /// <date>2014-09-22</date>
        /// </summary>
        /// <param name="id"></param>
        public void deleteFTP_New(decimal id)
        {
            dal.deleteFTP_New(id);
        }
        public void ChangeArchiveN(decimal id)
        {
            dal.ChangeArchiveN(id);
        }
              public void ChangeArchiveY(decimal id)
        {
            dal.ChangeArchiveY(id);
        }
        /// <summary>
        /// 判断该来栏目是否存在文件
        /// <creator>sunlj</creator>
        /// <date>2014-09-24</date>
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool ExistFile(decimal id)
        {
            return dal.ExistFile(id);
        }

        /// <summary>
        /// 判断该来栏目是否存在目录
        /// <creator>sunlj</creator>
        /// <date>2014-09-24</date>
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool ExistChildFTP_New(decimal id)
        {
            return dal.ExistChildFTP_New(id);
        }

        /// <summary>
        /// 获取当前目录的所有父级目录
        /// <creator>sunlj</creator>
        /// <date>2014-09-25</date>
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataTable GetListPre(decimal id)
        {
            DataSet ds = dal.GetListPre(id);
            return ds.Tables[0];
        }

        /// <summary>
        /// 批量增加FTP_New
        /// <creator>sunlj</creator>
        /// <date>2014-09-26</date>
        /// </summary>
        /// <param name="FTP_NewList"></param>
        public void AddFTP_NewList(List<Model.FTP_New> FTP_NewList)
        {
            dal.AddFTP_NewList(FTP_NewList);
        }


        /// <summary>
        /// 获得数据列表
        /// <creator>sunlj</creator>
        /// <date>2014-09-26</date>
        /// </summary>
        public List<ElingOA6_Admin_DSJCJ.Model.FTP_New> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }


        /// <summary>
        /// 移动文件位置
        /// <creator>sunlj</creator>
        /// <date>2014-09-30</date>
        /// </summary>
        /// <param name="FID"></param>
        /// <param name="newParentID"></param>
        public void moveFTP_NewFile(decimal FID, decimal newParentID)
        {
            dal.moveFTP_NewFile(FID, newParentID);
        }

        /// <summary>
        /// 重命名
        /// <creator>sunlj</creator>
        /// <date>2014-09-30</date>
        /// </summary>
        /// <param name="FID"></param>
        /// <param name="FName"></param>
        public void renameFTP_NewFile(decimal FID, string FName)
        {
            dal.renameFTP_NewFile(FID, FName);
        }

        /// <summary>
        /// 判断新的文件夹中是否有同名的文件
        /// <creator>sunlj</creator>
        /// <date>2014-10-10</date>
        /// </summary>
        /// <param name="newFParentID"></param>
        /// <param name="strOldFID"></param>
        /// <returns></returns>
        public bool ExistSameName(decimal newFParentID, string strOldFID)
        {
            return dal.ExistSameName(newFParentID, strOldFID);
        }

        /// <summary>
        /// 判断新的文件夹中是否有同名的文件
        /// <creator>sunlj</creator>
        /// <date>2014-10-10</date>
        /// </summary>
        /// <param name="newFParentID"></param>
        /// <param name="strOldFID"></param>
        /// <returns></returns>
        public bool ExistSameNameWithNewName(decimal newFParentID, string newName)
        {
            return dal.ExistSameNameWithNewName(newFParentID, newName);
        }

        /// <summary>
        /// 判断新的文件夹中是否有同名的文件
        /// <creator>sunlj</creator>
        /// <date>2014-10-10</date>
        /// </summary>
        /// <param name="newFParentID"></param>
        /// <param name="strOldFID"></param>
        /// <returns></returns>
        public bool ExistSameNameWithNewNameWhenNull(string newName)
        {
            return dal.ExistSameNameWithNewNameWhenNull(newName);
        }

        #endregion  已经使用的
    }
}

